import {Component, OnInit} from '@angular/core';
import {LocalStorageService} from '../../services/local-storage.service';
import {INIT_FLAG, START_USING_DATE, USERNAME} from '../../services/local-storage.namespace';
import {getTodayTime} from '../../../utils';

@Component({
  selector: 'app-setup',
  templateUrl: './setup.component.html',
  styleUrls: ['./setup.component.less']
})
export class SetupComponent implements OnInit {
  username: string; // 用户名

  constructor(private store: LocalStorageService) {
  }

  ngOnInit() {
  }

  completeSetup() {
    this.store.set(INIT_FLAG, true); // 存储初始化标识
    this.store.set(START_USING_DATE, getTodayTime()); // 存储当前日期
    this.store.set(USERNAME, this.username); // 存储用户名
  }
}
